package com.chenshu.controller;

import com.chenshu.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-03-31
 * Time：20:55
 */
@Controller
public class UserController1 {
    @Autowired
    private User user;

    public void doController() {
        System.out.println("Do UserController1");
        System.out.println("从Spring中取出user：" + user);
        User user2 = user;
        user2.setName("lisi");
        user2.setAge(18);
        System.out.println("修改后的数据" + user2);
    }
}
